package com.gopay.common.constants.bank.route;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * 付款路由常量值封装
 *
 * @author xj.x@hnair.com
 * @date 2018-04-16 17:16
 **/
public interface PayRouteConstants {

    /**
     * 对公对私标识
     *
     * @author xj.x@hnair.com
     * @date 2018-04-16 17:41
     */
    enum PubPriEnum {
        ALL("0", "全部"),
        PUB("1", "对公"),
        PRI("2", "对私");
        private String flag;
        private String desc;

        PubPriEnum(String flag, String desc) {
            this.flag = flag;
            this.desc = desc;
        }

        public String getFlag() {
            return flag;
        }

        public void setFlag(String flag) {
            this.flag = flag;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public static String getPubPriDesc(String flag) {
            for (PubPriEnum c : values()) {
                if (c.getFlag().equals(flag)) {
                    return c.getDesc();
                }
            }
            return "";
        }
    }

    /**
     * 是否生效
     *
     * @author xj.x@hnair.com
     * @date 2018-04-16 17:39
     */
    enum ValidEnum {
        ALL("0", "全部"),
        VALID("1", "已生效"),
        INVALID("2", "未生效");
        private String flag;
        private String desc;

        ValidEnum(String flag, String desc) {
            this.flag = flag;
            this.desc = desc;
        }

        public String getFlag() {
            return flag;
        }

        public void setFlag(String flag) {
            this.flag = flag;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public static String getValidDesc(String flag) {
            for (ValidEnum c : values()) {
                if (c.getFlag().equals(flag)) {
                    return c.getDesc();
                }
            }
            return "";
        }
    }

    /**
     * 规则类型
     *
     * @author xj.x@hnair.com
     * @date 2018-04-16 17:35
     */
    enum RuleTypeEnum {
        BASIC("B", "基本规则"),
        SPECIAL("S", "特殊规则");
        private String flag;
        private String desc;

        RuleTypeEnum(String flag, String desc) {
            this.flag = flag;
            this.desc = desc;
        }

        public String getFlag() {
            return flag;
        }

        public void setFlag(String flag) {
            this.flag = flag;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }
    }

    /**
     * 工作日节假日
     *
     * @author xj.x@hnair.com
     * @date 2018-04-16 17:32
     */
    enum WeekdayHolidayEnum {
        ALL("0", "全部"),
        WEEKDAY("1", "工作日"),
        HOLIDAY("2", "节假日");
        private String flag;
        private String desc;

        WeekdayHolidayEnum(String flag, String desc) {
            this.flag = flag;
            this.desc = desc;
        }

        public String getFlag() {
            return flag;
        }

        public void setFlag(String flag) {
            this.flag = flag;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public static String getWeekdayHolidayDesc(String flag) {
            for (WeekdayHolidayEnum c : values()) {
                if (c.getFlag().equals(flag)) {
                    return c.getDesc();
                }
            }
            return "";
        }
    }

    /**
     * 拆单标识 （NO-未拆单；YES-已拆单）
     *
     * @author xj.x@hnair.com
     * @date 2018-04-16 17:30
     */
    enum SplitBillEnum {
        ALL("0", "全部"),
        YES("1", "是"),
        NO("2", "否");
        private String flag;
        private String desc;

        SplitBillEnum(String flag, String desc) {
            this.flag = flag;
            this.desc = desc;
        }

        public String getFlag() {
            return flag;
        }

        public void setFlag(String flag) {
            this.flag = flag;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public static String getSplitBillDesc(String flag) {
            for (SplitBillEnum c : values()) {
                if (c.getFlag().equals(flag)) {
                    return c.getDesc();
                }
            }
            return "";
        }
    }

    /**
     * 删除标识
     *
     * @author xj.x@hnair.com
     * @date 2018-04-16 17:30
     */
    enum DeleteFlagEnum {
        ALL("0", "全部"),
        DELETED("1", "已删除"),
        UN_DELETED("2", "未删除");
        private String flag;
        private String desc;

        DeleteFlagEnum(String flag, String desc) {
            this.flag = flag;
            this.desc = desc;
        }

        public String getFlag() {
            return flag;
        }

        public void setFlag(String flag) {
            this.flag = flag;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }
    }

    /**
     * 付款渠道常量维护
     */
    enum PayProductEnum {
        ALL("0", "全部"),
        PAY_TO_BANK("00700", "付款到银行"),
        REFUND_TRANSFER("00701", "退款转账"),
        DRAW("00800", "提现"),
        SPEC_DRAW("01301", "专属账户提现"),
        MOB_TRANS_TO_BANK("01605", "手机转账到银行"),
        MOB_CREDIT_PAYMENT("01606", "手机信用卡还款"),
        CBRMB_PAY("01721", "跨境人民币支付（出口）"),
        FIN_PAY_TO_BANK("01617", "理财兑付到银行"),
    	CBRMB_ALLOCATION("01734", "跨境人民币拨款");
    	
        private String flag;
        private String desc;

        PayProductEnum(String flag, String desc) {
            this.flag = flag;
            this.desc = desc;
        }

        public String getFlag() {
            return flag;
        }

        public void setFlag(String flag) {
            this.flag = flag;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public static String getProdName(String code) {
            for (PayProductEnum c : values()) {
                if (c.getFlag().equals(code)) {
                    return c.getDesc();
                }
            }
            return "";
        }
    }

    enum InterChannelEnum {
        DIRECT_BANK("00","直连银行"),
        NUCC_PAY("18", "网联支付"),
        ICBC_SUPNET("21","工行超网"),
        ICBC_LG_AMT("22","工行大额")
        ;
        private String code;
        private String desc;

        InterChannelEnum(String code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }
        public static String getProdName(String code) {
            for (InterChannelEnum c : values()) {
                if (c.getCode().equals(code)) {
                    return c.getDesc();
                }
            }
            return "";
        }

        public static Map<String, String> getAllChannelMap() {
            Map<String, String> resultMap = new LinkedHashMap<>(10);
            for (InterChannelEnum c : values()) {
                resultMap.put(c.getCode(), c.getDesc());
            }
            return resultMap;

        }
    }
}
